<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise</title>
</head>
<body>
    
</body>
<script>
/* 
    创建promise实例
        var promise = new Promise((resolve, reject)=>{
            if(1>0){
                resolve()
            }else{
                reject()
            }

        })
    与await混用
        function sleep(ms){
            return new Promise((resolve, reject)=>{
                setTimeout(resolve, ms)
            })
        }
        async handle(){
            console.log('aaa')
            await sleep(5000)
            console.log('promise延迟后')
        }
        handle()
 */
</script>
</html>